package com.lw.question07;

import java.util.Scanner;

/**
 * @author LW
 * @2020/9/16 19:46
 */
public class 加位累积 {
    public static void main(String[] args) {
        //s=a+aa+aaa+aaaa+aa...a
        Scanner scanner = new Scanner(System.in);
        System.out.println("a 由键盘输入，且 2 ≤ a ≤9。");
        int a = scanner.nextInt();
        int s = 0;
        int num = 0;
        for (int i = 1; i <= a; i++) {
            num = num*10+a;
            s += num;
        }
        System.out.println(s);

    }
}
